﻿<!doctype html>
<html>
<!-- InstanceBegin template="/Templates/template1.dwt" codeOutsideHTMLIsLocked="false" -->
<head>
<meta charset="utf-8">
<!-- InstanceBeginEditable name="doctitle" -->
<title>入库管理</title>
<!-- InstanceEndEditable -->
<script type="text/javascript" src="../js/common.js"></script>
<link href="../css/Pager.css" type="text/css" rel="stylesheet" />
<script type="text/javascript" src="../js/jquery.pager.js"></script>
<link href="../css/style.css" type="text/css" rel="stylesheet" />
<script type="text/javascript" src="../js/utils.js"></script>
<script type="text/javascript" src="../js/shopSelecterNew.js"></script>
<script type="text/javascript" src="../js/pagination.js"></script>
<script type="text/javascript" src="../js/dataTable.js"></script>
<script type="text/javascript" src="../js/checkLogin.js"></script>
<script type="text/javascript" src="../js/doubleDate2.0.js"></script> 
<script type="text/javascript" src="../js/find.js"></script>
<script type="text/javascript" src="../js/qmsk-1.2.js"></script>
<script type="text/javascript" src="../js/commonSelecter.js"></script>
<!-- InstanceBeginEditable name="head" -->
<!-- InstanceEndEditable -->
<script type="text/javascript" >
var goodsIdList = new Array();
var rst = null;
var edtiRst = null;
var _pagination = null;
/**
 * 入口，和服务器的通信从此开始
 */
$(function() {
    Array.prototype.remove = function(val) {
        var index = this.indexOf(val);
        if (index > -1) {
            this.splice(index, 1);
        }
    };
    showSelectPanel();
	initSelectereds();
	initShopSelecter();
	$('.doubledate').kuiDate({
		className : 'doubledate',
		isDisabled : "1" // isDisabled为可选参数，“0”表示今日之前不可选，“1”标志今日之前可选
	});
	$('.doubledate1').kuiDate({
		className : 'doubledate1',
		isDisabled : "1" // isDisabled为可选参数，“0”表示今日之前不可选，“1”标志今日之前可选
	});
	
	$("#goodsBarcode").keypress(function(event){
		if(event.keyCode==13){
			addGoodsInfo();
		}
	});
});

function addGoodsInfo(){
/* 	var houseId = $("#addSelectInstock").val();
	if(IsEmpty(houseId)){
		artError("请选择库房");	
		return false;
	} */
	
	var supId = $("#addSupplier").val();
	if(IsEmpty(supId)){
		artError("请选择 供应商");	
		return false;
	}
	
/* 	var shopId =$("#shopID").val();
	if(IsEmpty(shopId)){
		artError("请先选择店铺 ");
		return false;
	} */
	var barCode = '';
	var code = '';
	var goodsCodeSelecter = $("#goodsCodeSelecter").val();
	if(goodsCodeSelecter == 'barCode'){
		barCode = $("#goodsBarcode").val();
	}else{
		code = $("#goodsBarcode").val();
	}
	
	var data = {supId:supId,barCode:barCode,code:code};
	
	qmsk.get('../goods/find/goodsList/opt/0/10', data, function(response) {
		if(response.state == 0){
			rst = response;
			addGoods();
		}
	});
}

/**
 * 初始化店面选择器
 */
function initShopSelecter() {
	refreshInput($(".serWrapper"));
	$("#shopID").attr("disabled", "disabled");

	$("#shopIsChoosed").bind("click", function() {
		var checked = $(this).attr("checked");
		if (checked) {
			$("#shopID").removeAttr("disabled");
		} else {
			$("#shopID").attr("disabled", "disabled");
			$("#shopID").empty();
		}
	});
}

//init查询条件
function initSelectereds(){
	$("#shopIsChoosed").removeAttr("checked");
	$("#shopID").html("");
	$("#selectSupplier").html("");
	$("#instockNO").val("");
	$("#startDate").val("");
	$("#endDate").val("");
	$("#maker").val("");
	$("#instockTp").val("");
	$("#status option:eq(0)").attr("selected","selected");
}

/**
 * 为查找做准备，这里主要是生成查询条件对象
 */
function toSearch() {
	$("#instockTable").empty();
	var maker = $("#maker").val();
	var shopId = $("#shopID").val();
	var selectSup = $("#selectSupplier").val();
	var instockNo = $("#instockNO").val();
	var startDate = $("#startDate").val();
	var endDate = $("#endDate").val();
	var instockTp = $("#instockTp").val();
	var status = $("#status").val();
	if(IsEmpty(shopId)){
		shopId = "";
	}
	if(IsEmpty(selectSup)){
		selectSup = "";
	}
	
	_pagination = new Pagination({
		url : '../inStore/find/opt/',
		data : {
			shopId : shopId,
			selectSupplier : selectSup,
			instockNO : instockNo,
			startDate : startDate,
			endDate : endDate,
			instockTp : instockTp,
			status : status
		},
		success : printDataToPage,
		pageSize : 10
	});
}

/**
 * 删除一行
 */
function toDelete(id,row) {
	if (IsEmpty(id)) {
		artError('未获取到主要信息！');
		return false;
	}
	
	var staName = $("#bill"+row).find("td:eq(7)").text();
	if(IsNotEmpty(staName)){
		if(staName == "已审"){
			artError("单据已审核。操作无效");
			return false;
		}
	}
	
	//直接发出请求
	artConfirm("确认删除吗？", function() {
		qmsk.post("../inStore/del",{'id' : id}, function(rst) {
			artSuccess("删除成功！");
			toSearch();
		});
	});
}


function printDataToPage(message){
	var oldBillNo = null;
	dataTable({
		tbodyId : 'instockTable',
		heads : ["shopName", "supName", "inNo", "inDate", "inTpName", "memo", "totalAmt", "staName", "maker", ["id"]],
		rst : message,
		handler : [{
			col : 9,
			f : detail
		}],
		trGender:trGenders,
		sup : {
			id : "sup",
			template : "共 [index] 条"
		}
	});
}

function trGenders(row){
	if(IsNotEmpty(row)){
		return "<tr id='bill"+row+"' ></tr>";
	}
}

/**
 * 显示添加弹出层
 */
function showAddPanel() {
	$("#selectGoodsStock").hide();
	$("#goodsStockAdd").show();
}

/**
 * 显示查询弹出层
 */
function showSelectPanel() {
	$("#selectGoodsStock").show();
	$("#goodsStockAdd").hide();
}

function toAdd(){
	if(initAddDiv()){
		showAddPanel();
	}
}

//初始化添加DIV
function initAddDiv(){
	var shopId =$("#shopID").val();
	if(IsEmpty(shopId)){
		artError("请先选择店铺 ");
		return false;
	}else{
		var htm="<option value='"+shopId+"'>"+$("#shopID").text()+"</option>";
		$("#selectShop").html(htm);
	}
	$("#checkId").val("");
	$("#sumNum").val(0);
	$("#sumTotal").val(0);
	$("#instockAddNO").val("");
	$("#instockAddDate").val(getToday());
	$("#addSupplier").html("");
	$("#addSelectInstock").html("");
	$("#addSelectInstockType").html("");
	$("#addsMemo").val("");
	$("#goodsCodeSelecter option:eq(0)").attr("selected","selected");
	$("#goodsBarcode").val("");
	$("#goodsIdSlecter").html("");
	$("#inGoodsStockTable").html("");
	$("#addSelectInstock").attr("disabled",false);
	$("#selectSupplier").attr("disabled",false);
	$("#addSupplier").attr("disabled",false);
	$("#addColumn1").attr("disabled",false);
	$("#addColumn2").attr("disabled",true);
	$("#addColumn2").addClass("filterBtn");
	goodsIdList.splice(0,goodsIdList.length)
	return true;
}

function initEditInfo(){
	$("#checkId").val("");
	$("#sumNum").val(0);
	$("#sumTotal").val(0);
	$("#instockAddNO").val("");
	$("#instockAddDate").val(getToday());
	$("#addSupplier").html("");
	$("#addSelectInstock").html("");
	$("#addSelectInstockType").html("");
	$("#addsMemo").val("");
	$("#inGoodsStockTable").html("");
	$("#goodsCodeSelecter option:eq(0)").attr("selected","selected");
	$("#goodsBarcode").val("");
	$("#goodsIdSlecter").html("");
	$("#addSelectInstock").attr("disabled",false);
	$("#selectSupplier").attr("disabled",false);
	$("#addSupplier").attr("disabled",false);
	$("#addColumn1").attr("disabled",false);
	$("#addColumn2").attr("disabled",false);
	$("#addColumn2").removeClass("filterBtn");
	goodsIdList.splice(0,goodsIdList.length)
	return true;
}

//返回查询界面
function toSelect(){
	$("#inGoodsStockTable").empty();
	showSelectPanel();
}

/* function toAddParent(){
	$("#addPUrl").val("");
	$("#addPName").val("");
	$("#window_change,#yinying1").show();
	addMargin($("#window_change2"));
} */

function toEdit(id,row){
	var staName = $("#bill"+row).find("td:eq(7)").text();
	if(IsNotEmpty(staName)){
		if(staName == "已审"){
			artError("单据已审核。操作无效");
			return false;
		}
	}
	
	qmsk.get('../inStore/find/editInfo', {
		id : id
	}, function(response) {
		if (response.state == 0) {
			showAddPanel();
			initEditInfo();
			rst = response;
			editGoods();
		}
	});
}


function detail(heads, row){
	return	"<input class='del common_btn' type='button' value='删除' onclick='toDelete("+heads[0]+","+row+")'>"+"<input class='edit common_btn' type='button' value='修改' onclick='toEdit("+heads[0]+","+row+")'>";
}

//选择供应商
function initSelectSup(tag){
	if(tag == 0){
		$("#selectSupplier").blur();
		$("#selectsup").val(0);
	}else{
		$("#addSupplier").blur();
		$("#selectsup").val(1);
	}
	initSelecter({
		url : '../supplier/find/supplierList',
		heads : ["code", "name"],
		titles : ["编码", "主菜单名称"],
		zindex : 500,
		callBack : callBack1
	});
}

function callBack1(response, row) {
	var id = response.getValue('id', row);
	var name = response.getValue('name', row);
	var sup = $("#selectsup").val();
	if(sup == 0){
		$("#selectSupplier").html("<option value='" + id + "' selected=\"selected\" >" + name + "</option>");
		$("#selectSupplier").attr("disabled",true);
	}else{
		$("#addSupplier").html("<option value='" + id + "' selected=\"selected\" >" + name + "</option>");
		$("#addSupplier").attr("disabled",true);
	}
}


//选择入库方式
function initSelectInTp(tag){
	if(tag == 0){
		$("#instockTp").blur();
		$("#selectInTp").val(0);
	}else{
		$("#addSelectInstockType").blur();
		$("#selectInTp").val(1);
	}
	
	initSelecter({
		url : '../inStockType/find/opt',
		heads : [ "code", "name" ],
		titles : [ "编码", "入库类型名称" ],
		zindex : 500,
		callBack : callBack
	});
}

	function callBack(response, row) {
		var id = response.getValue('id', row);
		var name = response.getValue('name', row);
		var intp = $("#selectInTp").val();
		if (intp == 0) {
			$("#instockTp").html(
					"<option value='" + id + "' selected=\"selected\" >" + name
							+ "</option>");
		} else {
			$("#addSelectInstockType").html(
					"<option value='" + id + "' selected=\"selected\" >" + name
							+ "</option>");
		}
	}

	//选择仓库
	function initSelectHouse() {
		$("#addSelectInstock").blur();
		initSelecter({
			url : '../wareHouse/find/wareHouseList',
			heads : [ "code", "name" ],
			data : {
				status : 1
			},
			titles : [ "编码", "库名称" ],
			zindex : 500,
			callBack : selectHouse
		});
	}

	function selectHouse(response, row) {
		var id = response.getValue('id', row);
		var name = response.getValue('name', row);
		$("#addSelectInstock").html(
				"<option value='" + id + "' selected=\"selected\" >" + name
						+ "</option>");
		$("#addSelectInstock").attr("disabled",true);
	}

	//选择商品
	function openGoodsListPanel() {
		$("#goodsIdSlecter").blur();
/* 		var houseId = $("#addSelectInstock").val();
		if (IsEmpty(houseId)) {
			art.dialog({
				fixed : true,
				lock : true,
				content : "请选择库房",
				icon : 'error',
				ok : true
			});
			return false;
		} */

		var supId = $("#addSupplier").val();
		if (IsEmpty(supId)) {
			artError("请先选择供应商");
			return false;
		}

		var shopId = $("#selectShop").val();
		if (IsEmpty(shopId)) {
			artError("请先选择店铺 ");
			return false;
		}

		initSelecter({
			url : '../goods/find/goodsList/opt',
			heads : [ "code", "barcode", "name" ],
			data : {
				status : 1,
				supId : supId,
				shopId : shopId
			},
			titles : [ "商品编码", "商品条码", "商品名称" ],
			zindex : 500,
			callBack : selectGoods
		});
	}

	function selectGoods(response, row) {
		var id = response.getValue('id', row);
		var name = response.getValue('name', row);
		$("#addGoodsIdRow").val(row);
		rst = response;
		$("#goodsIdSlecter").html(
				"<option value='" + id + "' selected=\"selected\" >" + name
						+ "</option>");
	}

	//数量。物品价格改动事件
	function changeNums(id) {
		var nums = $("#goodsNum_" + id).val();
		if (IsEmpty(nums)) {
			nums = 0;
		}

		var price = $("#goodsPrice_" + id).val();
		if (IsEmpty(price)) {
			price = 0;
		}
		
		var total = getFloatValue(nums, price);
		$("#goodsTotal_" + id).val(total);

		nums = 0;
		total = 0;
		$("#inGoodsStockTable tr").each(
				function() {
					var num = $(this).find("td:eq(4)").find("input").val();
					nums = parseInt(nums) + parseInt(num);
					var tal = $(this).find("td:eq(6)").find("input").val();
					total = parseInt(total) + parseInt(tal);

		});

		$("#sumNum").val(nums);
		$("#sumTotal").val(total);
	}
	
	function changeGoodsInfo(){
		var nums = 0;
		var total = 0;
		$("#inGoodsStockTable tr").each(
				function() {
					var num = $(this).find("td:eq(4)").find("input").val();
					nums = parseInt(nums) + parseInt(num);
					var tal = $(this).find("td:eq(6)").find("input").val();
					total = parseInt(total) + parseInt(tal);

		});
		$("#sumNum").val(nums);
		$("#sumTotal").val(total);
	}

	//取后小数点数后2位 并 四舍五入
	function getFloatValue(floaltV1, floaltV2) {
		return Number(((floaltV1 * 100) * (floaltV2 * 100)) / 10000).toFixed(2);
	}
	
	function editGoods(){
		if (IsNotEmpty(rst)) {
			var goodsId = rst.getValue('id', 0);
			$("#selectShop").html("<option value='" + rst.getValue('shopId', 0) + "' selected=\"selected\" >" + rst.getValue('shopName', 0)
					+ "</option>");
			$("#addSupplier").html("<option value='" + rst.getValue('supId', 0) + "' selected=\"selected\" >" + rst.getValue('supName', 0)
					+ "</option>");
			$("#addSelectInstockType").html("<option value='" + rst.getValue('inTypeId', 0) + "' selected=\"selected\" >" + rst.getValue('inTypeName', 0)
					+ "</option>");
			$("#addSelectInstock").html("<option value='" + rst.getValue('houseId', 0) + "' selected=\"selected\" >" + rst.getValue('houseName', 0)
					+ "</option>");
			$("#addsMemo").val(rst.getValue('memo', 0));
			$("#instockAddNO").html(rst.getValue('InBillNo', 0));
			var adddate = rst.getValue('instockAddDate', 0);
			$("#instockAddDate").html(adddate.substring(0,10));
			$("#checkId").val(goodsId);
			for(var row = 0;row<rst.length;row++){
				goodsId = rst.getValue('goodsId', row);
				goodsIdList.push(goodsId);
				var html = "<tr id=\"goodsId_"+goodsId+"\"><td> <input type='hidden' class='goodsId' value='"+goodsId+"'/>"
						+ rst.getValue('barcode', row)
						+ "</td><td>"
						+ rst.getValue('goodsCode', row)
						+ "</td><td>"
						+ rst.getValue('goodsName', row)
						+ "</td><td>"
						+ rst.getValue('mode', row)
						+ "</td><td><input type='text' value='"+rst.getValue('nums', row)+"' class='goodsNumCls' style='border: 0px'  onchange=\"changeNums("
						+ goodsId
						+ ")\" id=\"goodsNum_"
						+ goodsId
						+ "\" /></td><td><input type='text' value='"+rst.getValue('price', row)+"' style='border: 0px'  onchange=\"changeNums("
						+ goodsId
						+ ")\"  id=\"goodsPrice_"
						+ goodsId
						+ "\" /></td><td><input type='text' value='"+rst.getValue('Money', row)+"' disabled='disabled'  style='border: 0px' class='goodsTotalCls' id=\"goodsTotal_"+goodsId+"\" /></td><td><input type='text' style='border: 0px' id=\"rackName_"+goodsId+"\" value='无'/></td><td><input  class=\"common_btn del\" type=\"button\" value=\"删除\" onclick=\"deleteTr("
						+ goodsId + ")\"  /></td></tr>";
				$("#inGoodsStockTable").append(html);
			}
			changeGoodsInfo();
		} else {
			artError("未获取到物品信息");
			return false;
		}
	}

	//addGoods
	function addGoods() {
		if (IsNotEmpty(rst)) {
			var row = $("#addGoodsIdRow").val();
			var goodsId = rst.getValue('id', row);
			var goodsLLenth = goodsIdList.length;
			if(goodsLLenth>0){
				for(var i=0;i<goodsLLenth;i++){
					var listId = goodsIdList[i];
					if(listId == goodsId){
						artError("不能重复添加已有物品信息");
						return false;
					}else{
						goodsIdList.push(goodsId);
					}
				}
			}else{
				goodsIdList.push(goodsId);
			}
			
			var html = "<tr id=\"goodsId_"+goodsId+"\"><td> <input type='hidden' class='goodsId' value='"+goodsId+"'/>"
					+ rst.getValue('barcode', row)
					+ "</td><td>"
					+ rst.getValue('code', row)
					+ "</td><td>"
					+ rst.getValue('name', row)
					+ "</td><td>"
					+ rst.getValue('mode', row)
					+ "</td><td><input type='text' value='1' class='goodsNumCls' style='border: 0px'  onchange=\"changeNums("
					+ goodsId
					+ ")\" id=\"goodsNum_"
					+ goodsId
					+ "\" /></td><td><input type='text' value='0' style='border: 0px'  onchange=\"changeNums("
					+ goodsId
					+ ")\"  id=\"goodsPrice_"
					+ goodsId
					+ "\" /></td><td><input type='text' value='0' disabled='disabled'  style='border: 0px' class='goodsTotalCls' id=\"goodsTotal_"+goodsId+"\" /></td><td><input type='text' style='border: 0px' id=\"rackName_"+goodsId+"\" value='无'/></td><td><input  class=\"common_btn del\" type=\"button\" value=\"删除\" onclick=\"deleteTr("
					+ goodsId + ")\"  /></td></tr>";
			$("#inGoodsStockTable").append(html);
			changeGoodsInfo();
		} else {
			artError("未获取到物品信息");
			return false;
		}
	}

	//删除一行
	function deleteTr(goodsId) {
		artConfirm("确认删除吗？", function() {
			var nums = $("#goodsNum_" + goodsId).val();
			if (IsEmpty(nums)) {
				nums = 0;
			}
			var total = $("#goodsTotal_" + goodsId).val();
			if (IsEmpty(total)) {
				total = 0;
			}
			$("#goodsId_" + goodsId).remove();
			changeGoodsInfo();
			goodsIdList.remove(goodsId);
		});
	}

	//保存单据
	function toAddStockBill() {
		var i = 0;
		var houseId = $("#addSelectInstock").val();
		if (IsEmpty(houseId)) {
			artError("请选择库房");
			return false;
		}

		var supId = $("#addSupplier").val();
		if (IsEmpty(supId)) {
			artError("请选择 供应商");
			return false;
		}

		var intyId = $("#addSelectInstockType").val();
		if (IsEmpty(intyId)) {
			artError( "请选择入库类型");
			return false;
		}

		var shopId = $("#selectShop").val();
		if (IsEmpty(shopId)) {
			artError("请先选择店铺 ");
			return false;
		}
		
		var len =$("#inGoodsStockTable tr").length;
		if(len == null || len <=0 ){
			artError("请添加商品");
			return false;
		}
			
		var jsonParserStr1 = "";
		var jsonParserStr2 = "";
		var parser1 = new Object();
		var parser2 = new Object();
		$("#inGoodsStockTable tr").each(
				function() {
					var id = $(this).find("td:first").find("input").val();
					var price = $("#goodsPrice_"+id).val();
					var goodsNum = $("#goodsNum_"+id).val();
					var total = $("#goodsTotal_"+id).val();
					var rackName = $("#rackName_"+id).val();
					if (price != null && price > 0) {
						i++;
						var head = new Array("no", "goodsId", "houseId",
								"nums", "price", "money", "rackName");
						var data = new Array(i, id, houseId,
								goodsNum,
								price,
								total,
								rackName);
						if (IsNotEmpty(data)) {
							addToParser(head, data, "add", parser2);
							jsonParserStr2 = JSON.stringify(parser2);
						}
					}
		});
		var len =$("#inGoodsStockTable tr").length;
		var instockAddNO = $("#instockAddNO").val();
		var instockAddDate = $("#instockAddDate").val();
		var addMemo = $("#addsMemo").val();
		var id = $("#checkId").val();
		var head = null;
		var data = null;
		var stotal = $("#sumTotal").val();
		if(IsNotEmpty(id)){
			head = new Array("shopId", "inTpId", "supplierID", "makeDate","totalAmt",
					"memo","id");
			data = new Array(shopId, intyId, supId, instockAddDate, stotal, addMemo,id);
		}else{
			head = new Array("shopId", "inTpId", "supplierID", "makeDate","totalAmt",
			"memo");
			data = new Array(shopId, intyId, supId, instockAddDate,stotal, addMemo);
		}

		if (IsNotEmpty(data) && IsNotEmpty(id) ) {
			addToParser(head, data, "edit", parser1);
			jsonParserStr1 = JSON.stringify(parser1);
		}else{
			addToParser(head, data, "add", parser1);
			jsonParserStr1 = JSON.stringify(parser1);
		}
		

		qmsk.post('../inStore/insert/shopId/' + shopId, {
			data : jsonParserStr1,
			inStoreDtl : jsonParserStr2
		}, function(response) {
			if (response.state == 0) {
				artSuccess('更新成功！');
				$("#addColumn1").attr("disabled","disabled");
				var inno = response.getValue('inNo', 0);
				$("#instockAddNO").val(inno);
				$("#checkId").val(response.getValue('id', 0));
				$("#addColumn1").attr("disabled",true);
				$("#addColumn2").removeClass("filterBtn");
				$("#addColumn1").addClass("filterBtn");
				$("#addColumn2").attr("disabled",false);
			}
		});
	}
	
	//执行入库
	function toCheckGoodsStock(){
		var id = $("#checkId").val();
		if(IsEmpty(id)){
			artError("未找到主要信息");
			return false;
		}
		qmsk.post('../inStore/check', {
			id : id
		}, function(response) {
			if (response.state == 0) {
				artSuccess('入库成功');
				showSelectPanel();
				$("#checkId").val("");
				toSearch();
			}
		});
	}
</script>
</head>

<body>
		<div id="yinying"></div>
		<div id="yinying1"></div>
		<input type="hidden"  id="selectsup"/>
		<input type="hidden"  id="selectInTp"/>
		<input type="hidden"  id="addGoodsIdRow"/>
		<input type="hidden"  id="checkId"/>

		

<div class="container" id="container">
  <div class="container_R fr" id="selectGoodsStock">
    <div class="place">入库管理</div>
    <div class="member_search">
      <p>
      	<span> <input type="checkbox" id="shopIsChoosed"
						style="width: auto; height: auto; border: none;"> 店面：
		</span><select id="shopID"  class="shopName" onclick="openShopListPanel(this)" style="height: 20px;"></select>
      <span>
         	供应商：</span><select id="selectSupplier" onclick="initSelectSup(0)"></select>
         <span>
         	入库单号：</span><input id="instockNO" />
      </p>
      <p>
	      	<span>入库日期：从</span> <input type="text" readonly class="doubledate ipticon" id="startDate" /> 
	      	<span>到： </span> <input type="text" readonly class="doubledate1 ipticon" id="endDate" />
	      	<span>入库方式：</span> <select id="instockTp" onclick="initSelectInTp(0)"></select>
      </p>
      <p>
		       	    <span>制单人： </span><input type="text" id="maker" />
 					<span>状态：</span> <select id="status">
     	    			<option value="0">未审</option>
     	    			<option value="1">已审</option>
     	    		</select>
     	    <input type="button" value="查询" class="btn" onclick="toSearch()">
      </p>
    </div>
    <table width="100%" class="member_list"   cellpadding="0" cellspacing="1" border="0" id="memberList">
      <caption>
      <strong>入库单列表 <span id="sup">共0条</span></strong>
       <input type="button" class="common_btn"  value="新增" id="addColumn" onclick="toAdd()">
      </caption>
      <thead>
        <tr>
          <th>店面</th>
          <th>供应商</th>
          <th>入库单号</th>
          <th>入库日期</th>
          <th>入库方式</th>
          <th>备注</th>
          <th>入库金额</th>
          <th>状态</th>
          <th>制单人</th>
          <th>操作</th>
        </tr>
      </thead>
      <tbody id="instockTable">
      </tbody>
    </table>
     <div id="NoResult"  class="Nothing" style="text-align:center;display: none;">无符合条件的数据！</div>
    <div id="pager" class="pager"></div>
  </div>
  
  	<!-- 增加修改界面 -->
  		<div class="container_R fr" style="padding: 17px; width: 773px;" id="goodsStockAdd">
		   <div class="place"><a onclick="toSelect()">入库管理</a><span> &gt;</span><span>增加入库单</span><a class="goHome"  style="cursor: pointer;" onclick="toSelect()">返回</a></div>
			    <div class="member_search" style="margin-top:15px;margin-bottom:-10px;">
			      <p><span>店面：</span><select id="selectShop" disabled="disabled"></select>
			      	<span>入库单号：</span><input id="instockAddNO" />
			      	<span>制单日期：</span><input id="instockAddDate" disabled="disabled" />
			      </p>
			      <p>
			      	<span>供应商：</span><select id="addSupplier" onclick="initSelectSup(1)"></select>
			      	<span>入库方式：</span><select id="addSelectInstockType" onclick="initSelectInTp(1)"></select>
			      	<span>库房：</span><select id="addSelectInstock" onclick="initSelectHouse()"></select>
			      </p>
			     <p>
			     	<span>备注：</span><textarea id="addsMemo" class='memoClass'></textarea>
			     </p>
			      <select id="goodsCodeSelecter" style="width:80px">
			        <option value="barCode">商品条码</option>
			        <option value="code">商品编码</option>
			      </select>
			      <input type="text"  id="goodsBarcode" class="memberInfo absoluteTxt"  >
			      <span>商品选择：</span><select id="goodsIdSlecter" onclick="openGoodsListPanel()">
			      </select>
			      <input class="btn common_btn" name="查询" type="button" value="添加"  onclick="addGoods()">
			          
			    </div>
			    <table width="100%" class="member_list" cellpadding="0" cellspacing="1" border="0" id="memberList1">
				   <caption>
				      <strong>入库商品列表 </strong>
				      <input type="button"  value="保存" class="common_btn" id="addColumn1" onclick="toAddStockBill()">
			          <input type="button" value="执行入库" class="common_btn" id="addColumn2" onclick="toCheckGoodsStock()">
				   </caption>
				      <thead>
				        <tr>
				          <th>商品条码</th>
				          <th>商品编号</th>
				          <th>商品名称</th>
				          <th>规格型号</th>
				          <th>数量</th>
				          <th>含税单价</th>
				          <th>含税小计</th>
				          <th>库房名称</th>
				          <th>货位</th>
				          <th>操作</th>
				        </tr>
				      </thead>
				      <tbody id="inGoodsStockTable">
				      </tbody>
				    </table>
				    <span>数量总计:<input type="text" id="sumNum" style="border: 0px"/></span><span>含税总计:<input type="text" id="sumTotal" style="border: 0px"/></span>
		</div>
  <div class="fc"></div>
</div>
<!-- InstanceEndEditable --> 
<script type="text/javascript" src="../js/header.js"></script> 
<script type="text/javascript" src="../js/left.js"></script> 
<script type="text/javascript" src="../js/footer.js"></script> 
<script type="text/javascript">
clearThis("absoluteTxt");
</script>
</body>
<!-- InstanceEnd -->
</html>
